home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
qbsub10.arc
/
KEYDMO.ASC
< prev
next >
Wrap
Text File
|
1986-06-25
|
2KB
|
69 lines
' KEYDMO.ASC -- MSDOS QuickBASIC GETKEY.SUB subroutines test 25 June 86
' by David L. Poskie (608) 274-9560
' 7118 Raymond Rd. Madison, WI 53719
' Please run any suggestions, corrections, additions, or changes by me.
' I can be messaged on all the major Madison, WI RBBS's.
' Compile syntax: BASCOM KEY.ASC /D; | LINK KEY;
GOTO Start
Rem $Include: 'OMNI.SUB'
Start:
COLOR 14 , 3 , 8
CLS
LOCATE 3 , 1
Text$ = "GetKey subroutines test . . ."
GOSUB Center
GOSUB GetKeyPress
CLS
Text$ = "Well, GetKeyPress seems to work"
GOSUB Center
PRINT
Temp$ = ""
Text$ = "Type in a short string of"
GOSUB Center
Text$ = "mixed-case characters: "
GOSUB CenterStay
LINE INPUT Temp$
GOSUB GetUpperCase
Text$ = "Here's your string in upper case:"
GOSUB Center
PRINT
Text$ = Temp$
GOSUB Center
GOSUB GetKeyPress
LOCATE 12 ,1
Text$ = "In this last test, press any key"
GOSUB Center
Loop:
LOCATE 14 ,1
Text$ = "Press <ESC> to exit this test and the program"
GOSUB Center
Text$ = "Press a key . ."
GOSUB Center
' Get the extended key code & ASCII code of the key just pressed
GOSUB GetKeyCode
Text$ = "ASCII key code is" + STR$(KeyCode)
GOSUB Center
Text$ = " Extended code is" + STR$(ExtendedCode)
GOSUB Center
Text$ = "Character is " + CHR$(KeyCode)
GOSUB Center
Dly = 2 ' 2 seconds delay
GOSUB Delay
Dly = 0 ' Set up to use ClearOut
WHILE INKEY$ <> "" ' Clear the keyboard buffer
WEND
IF KeyCode = 27 _
AND ExtendedCode = 0 _
THEN GOTO LoopExit _
ELSE Num = 4 : _
GOSUB ClearOut : _
GOTO Loop
LoopExit:
SYSTEM
' >>>>> Physical EOF KEYDMO.ASC 25 June 86